import request from '@/utils/request'

export default{

    /**
     * 根据课程id查询所有章节和小节列表
     * @param {课程id} courseId 
     * @returns 
     */
    getAllChapterVideo(courseId){
        return request({
            url: '/eduservice/chapter/getChapterVideo/' + courseId,
            method: 'get'
        })
    },

    /**
     * 添加章节
     * @param {要添加的章节表单} chapter 
     * @returns 
     */
    addChapter(chapter){
        return request({
            url: '/eduservice/chapter/addChapter',
            method: 'post',
            data: chapter
        })
    },

    /**
     * 根据id查询章节
     * @param {章节id}} chapterId 
     * @returns 
     */
    getChapter(chapterId){
        return request({
            url: '/eduservice/chapter/getChapterInfo/' + chapterId,
            method: 'get'
        })
    },

    /**
     * 修改章节
     * @param {要修改的章节表单} chapter 
     * @returns 
     */
    updateChapter(chapter){
        return request({
            url: '/eduservice/chapter/updateChapter',
            method: 'post',
            data: chapter
        })
    },

    /**
     * 根据id删除章节
     * @param {章节id}} chapterId 
     * @returns 
     */
    deleteChapter(chapterId){
        return request({
            url: '/eduservice/chapter/' + chapterId,
            method: 'delete'
        })
    }



}
